

/**
 *	Field Summary:
 *		Match m -- 
 *			Match object responsible for playing a single match.
 *	
 *	Constructor Summary:
 *		GameSystem() --
 *			Default constructor to initialize member fields.
 *	Method Summary:
 *		int run () -- 
 *			Method that execute playing of a match. Returns int 
 *			to verify proper termination. 
 *  
 *  Primary Author: MS
 */

public class GameSystem {
 
   public void run (int numOfThrows,                           
                          String difficulty)                         
   {
     
    boolean continuePlaying = true;
      
    // Play RPS
    while (continuePlaying) 
    {      
      // Play a match
      if (numOfThrows > 0)
      {
        Match m = new Match( numOfThrows, difficulty );
        
        // Terminate application at end of match                     
        continuePlaying = false;                                     
      }

      else
      { continuePlaying = false; }
    }
     
    
  }
  
  private static boolean validate (String [] args)
  {
    String random = "random";
    String smart = "smart";
    
      if (args.length == 2) { // valid number of arguments
        if ( (args[1].compareToIgnoreCase(random) != 0) && 
             (args[1].compareToIgnoreCase(smart) != 0) ) {
                return false;
        }
      }
      else 
      { return false; }

    return true;
  }
}